/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nsip.components.ds.bi;

/**
 *
 * @author nico.rehwaldt
 */
public class NormalizedHistory extends Metric {
    
    private double normalization;
    private double value;

    public NormalizedHistory(double normalization, double startValue) {
        this.normalization = normalization;
        this.value = startValue;
    }

    @Override
    public void update(double value) {
        this.value = (1 - normalization) * this.value +
                     (normalization * value);
    }
    
    public double value() {
        return value;
    }
}
